<template>
  <view class="page">
    <view class="head">
      <!-- <view class="header-left">
        <image src="/static/switch-icon.png" mode="aspectFit"></image>
        <text>切换商家</text>
      </view> -->
      <view class="header">
        <view class="merchant-info">
          <image src="/static/user-icon.png" mode="aspectFit" class="profile"></image>
          <text class="name">商家名称</text>
        </view>
        <view class="header-right">
          <button open-type="scanCode" class="scan-button">
            <!-- <image src="/static/use_code.png" mode="aspectFit"></image> -->
            <text>扫码核销</text>
          </button>
        </view>
      </view>

      <view class="authorization">
        <view class="authorization-title">授权开通</view>
        <view class="authorization-description">授权真省钱，进行外卖单聚合管理</view>
        <button class="authorize-button">立即授权</button>
      </view>
    </view>

    <view class="body">
      <view class="today-data">
        <view class="">
          <view class="data-title">今日数据 更新于11:27</view>
          <view class="more-link">
            <text>查看更多 &gt;</text>
          </view>
        </view>

        <view class="data-items">
          <view class="data-item">
            <text>0.00</text>
            <text>支付金额（元）</text>
          </view>
          <view class="data-item">
            <text>0</text>
            <text>支付订单数</text>
          </view>
          <view class="data-item">
            <text>0</text>
            <text>支付客户数</text>
          </view>
        </view>
      </view>

      <view class="tools">
        <view class="tool-title">常用工具</view>
        <view class="tool-grid">
          <view class="tool-item" v-for="(tool, index) in toolsList" :key="index">
            <view class="tool-icon" :style="{ backgroundImage: `url(${tool.icon})` }"></view>
            <text>{{tool.name}}</text>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      toolsList: [
        { icon: '/static/icon32(1).png', name: '订单管理' },
        { icon: '/static/icon32(1).png', name: '输码验券' },
        { icon: '/static/icon32(1).png', name: '资产信息' },
        { icon: '/static/icon32(1).png', name: '收款码' },
        { icon: '/static/icon32(1).png', name: '硬件设备' },
        { icon: '/static/icon32(1).png', name: '团购管理' },
        { icon: '/static/icon32(1).png', name: '员工管理' },
        { icon: '/static/icon32(1).png', name: '门店管理' },
        { icon: '/static/icon32(1).png', name: '联系客服' },
        { icon: '/static/icon32(1).png', name: '我的抽点' },
      ]
    };
  },
  methods: {
    // 方法
  }
};
</script>

<style scoped>
.page {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #f5f5f5;
}

.head {
  width: 100%;
  height: 25%;
  flex-shrink: 0;
  background: linear-gradient(128deg, #002DAA 5.95%, #0E2870 101.69%);
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  color: white;
}

.merchant-info {
  display: flex;
  align-items: center;
  padding: 20px;
}

.profile {
  width: 56px;
  height: 56px;
  border-radius: 56px;
  border: 1px solid #FFF;
  background: url(/static/image.png) lightgray 50% / cover no-repeat;
  margin-right: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.name {
  color: #ffffff;
  font-family: "PingFang SC";
  font-size: 18px;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
}

.header-right {
  display: flex;
  align-items: center;
}

.scan-button {
  display: inline-flex;
  padding: 6px 14px;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border-radius: 6px;
  background: var(--, linear-gradient(109deg, #FBDBC2 2.7%, #F2C29D 88.1%));
  color: #333;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.scan-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.authorization {
  padding: 20px;
  background-color: #f8bbd0;
  border-radius: 10px;
  margin: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.authorization-title {
  font-size: 20px;
  margin-bottom: 10px;
  color: #333;
}

.authorization-description {
  margin-bottom: 10px;
  color: #666;
}

.authorize-button {
  border-radius: 50px;
  padding: 10px 20px;
  background-color: #2979ff;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.authorize-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.today-data {
  padding: 20px;
  background-color: #fff;
  border-radius: 10px;
  margin: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.data-title {
  font-size: 16px;
  margin-bottom: 10px;
  color: #333;
}

.data-items {
  display: flex;
  justify-content: space-around;
}

.data-item {
  text-align: center;
  color: #666;
}

.more-link {
  text-align: right;
  margin-top: 10px;
}

.more-link text {
  color: #2979ff;
  cursor: pointer;
}

.tools {
  padding: 2
}
</style>